public class Solution {

    public static void main(String[] args) {
	if (args.length < 1)
		return;
	Solution s = new Solution();
	int[] A = new int[args.length];
	for (int i = 0; i < args.length; ++i) {
		A[i] = Integer.parseInt(args[i]);
	}

	int result = s.singleNumber(A);
	System.out.println(result);
    }

    public int singleNumber(int[] A) {

        int width = getBitWidth();

        int result = 0;

        for (int bit = 0; bit < width; ++bit) {

            int bc = 0;

            for (int a : A) {

                bc += getBit(a, bit);

            }

            if (bc % 3 == 1)

                result |= (1<<bit);

        }

        

        return result;

    }

    

    private int getBitWidth() {

        int x = ~0;

        int count = 0;

        while(x != 0) {

            x >>= 1;

            count++;

        }

        

        return count;

    }

    

    private int getBit(int a, int bit) {

        if ((a & (1<<bit)) == 0)

            return 0;

        else

            return 1;

    }

}
